package com.lich.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.json.MappingJackson2JsonView;

import com.lich.controller.base.BaseController;
import com.lich.entity.AccessLog;
import com.lich.entity.vo.Page;
import com.lich.entity.vo.Result;
@Controller
@RequestMapping("/accessLog")
public class AccessLogController extends BaseController {
	
	@RequestMapping(value ="/list",method=RequestMethod.GET)
	public ModelAndView list(HttpServletRequest request){
		return new ModelAndView("manager/accessManager/accessLogList");
	}
	
	
	@RequestMapping(value ="/doList",method=RequestMethod.POST)
	public ModelAndView doList(HttpServletRequest request,Page<AccessLog> page){
		Result<Object> result = new Result<>();
		Page<AccessLog> list =null;
		try {
			list = accessLogService.list(page);
			
			
		} catch (Exception e) {
			// TODO: handle exception
			result.setSuccess(false);
			result.setMessage("获取报错信息失败");
		}
		result.setObject(list);
		result.setSuccess(true);
		result.setMessage("获取报错信息成功");
		
		
		return new ModelAndView(new MappingJackson2JsonView(),"result",result);
	}
	

}
